﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Kazuku.Core.Controllers;
using Kazuku.Core.Models;
using Norm;
using NormActiveRecord;


namespace Kazuku.Web.Controllers {
	public class PageController : KazukuController {
		#region Constructors
		public PageController(IModelFactory modelFactory, HttpContextBase httpContext) : base(modelFactory, httpContext) { }
		#endregion Constructors

		public ActionResult Show(ObjectId id) {
			Current.Page = Model.New<Page>().Single(p => p.ID == id);
			ViewData["Message"] = "Welcome to ASP.NET MVC!";
			TempData["Test"] = "I am here";
			
			return View(DynamicTemplate.GetViewName(Current.Site.OrgCode, Current.Site.SiteTemplateName), Current.Page);
		}

	}
}
